package com.ruoyi.business.device.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 设备信息对象 business_device
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
public class Device extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 设备ID */
    private Long deviceId;

    /** 设备名称 */
    private String deviceName;

    /** 设备中继编码（从机地址） */
    private String deviceRelayCode;

    /** 设备类型（TCP/RTU） */
    private String deviceType;

    /** IP地址 */
    private String ipAddress;

    /** 端口号 */
    private Integer port;

    /** 串口号 */
    private String serialPort;

    /** 波特率 */
    private Integer baudRate;

    /** 数据位 */
    private Integer dataBits;

    /** 停止位 */
    private Integer stopBits;

    /** 校验位 */
    private String parity;

    /** 设备包含的槽数 */
    private Integer slotCount;

    /** 每个槽包含的点位数 */
    private Integer pointsPerSlot;

    /** 槽的偏移量 */
    private Integer slotOffset;

    /** 起始槽号 */
    private Integer startSlotNumber;

    /** 终止槽号 */
    private Integer endSlotNumber;

    /** 设备状态（0正常 1停用 2故障） */
    private String status;

    /** 连接状态（0断开 1连接 2连接中） */
    private String connectionStatus;

    /** 最后通信时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastCommTime;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    public void setDeviceId(Long deviceId) 
    {
        this.deviceId = deviceId;
    }

    public Long getDeviceId() 
    {
        return deviceId;
    }
    public void setDeviceName(String deviceName) 
    {
        this.deviceName = deviceName;
    }

    public String getDeviceName() 
    {
        return deviceName;
    }
    public void setDeviceRelayCode(String deviceRelayCode) 
    {
        this.deviceRelayCode = deviceRelayCode;
    }

    public String getDeviceRelayCode() 
    {
        return deviceRelayCode;
    }
    public void setDeviceType(String deviceType) 
    {
        this.deviceType = deviceType;
    }

    public String getDeviceType() 
    {
        return deviceType;
    }
    public void setIpAddress(String ipAddress) 
    {
        this.ipAddress = ipAddress;
    }

    public String getIpAddress() 
    {
        return ipAddress;
    }
    public void setPort(Integer port) 
    {
        this.port = port;
    }

    public Integer getPort() 
    {
        return port;
    }
    public void setSerialPort(String serialPort) 
    {
        this.serialPort = serialPort;
    }

    public String getSerialPort() 
    {
        return serialPort;
    }
    public void setBaudRate(Integer baudRate) 
    {
        this.baudRate = baudRate;
    }

    public Integer getBaudRate() 
    {
        return baudRate;
    }
    public void setDataBits(Integer dataBits) 
    {
        this.dataBits = dataBits;
    }

    public Integer getDataBits() 
    {
        return dataBits;
    }
    public void setStopBits(Integer stopBits) 
    {
        this.stopBits = stopBits;
    }

    public Integer getStopBits() 
    {
        return stopBits;
    }
    public void setParity(String parity) 
    {
        this.parity = parity;
    }

    public String getParity() 
    {
        return parity;
    }
    public void setSlotCount(Integer slotCount) 
    {
        this.slotCount = slotCount;
    }

    public Integer getSlotCount() 
    {
        return slotCount;
    }
    public void setPointsPerSlot(Integer pointsPerSlot) 
    {
        this.pointsPerSlot = pointsPerSlot;
    }

    public Integer getPointsPerSlot() 
    {
        return pointsPerSlot;
    }
    public void setSlotOffset(Integer slotOffset) 
    {
        this.slotOffset = slotOffset;
    }

    public Integer getSlotOffset() 
    {
        return slotOffset;
    }
    public void setStartSlotNumber(Integer startSlotNumber) 
    {
        this.startSlotNumber = startSlotNumber;
    }

    public Integer getStartSlotNumber() 
    {
        return startSlotNumber;
    }
    public void setEndSlotNumber(Integer endSlotNumber) 
    {
        this.endSlotNumber = endSlotNumber;
    }

    public Integer getEndSlotNumber() 
    {
        return endSlotNumber;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setConnectionStatus(String connectionStatus) 
    {
        this.connectionStatus = connectionStatus;
    }

    public String getConnectionStatus() 
    {
        return connectionStatus;
    }
    public void setLastCommTime(Date lastCommTime) 
    {
        this.lastCommTime = lastCommTime;
    }

    public Date getLastCommTime() 
    {
        return lastCommTime;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("deviceId", getDeviceId())
            .append("deviceName", getDeviceName())
            .append("deviceRelayCode", getDeviceRelayCode())
            .append("deviceType", getDeviceType())
            .append("ipAddress", getIpAddress())
            .append("port", getPort())
            .append("serialPort", getSerialPort())
            .append("baudRate", getBaudRate())
            .append("dataBits", getDataBits())
            .append("stopBits", getStopBits())
            .append("parity", getParity())
            .append("slotCount", getSlotCount())
            .append("pointsPerSlot", getPointsPerSlot())
            .append("slotOffset", getSlotOffset())
            .append("startSlotNumber", getStartSlotNumber())
            .append("endSlotNumber", getEndSlotNumber())
            .append("status", getStatus())
            .append("connectionStatus", getConnectionStatus())
            .append("lastCommTime", getLastCommTime())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
